package icu.lookyousmileface.boot_admin.controller

import icu.lookyousmileface.boot_admin.pojo.User
import org.springframework.stereotype.Controller
import org.springframework.ui.Model
import org.springframework.ui.set
import org.springframework.web.bind.annotation.GetMapping
import java.util.ArrayList

/**
 * @title: TablesController
 * @projectName boot_admin
 * @description: 用于处理一级目录中的Data Tabels中的子单元
 * @author starrysky
 * @date 2021/1/14:09 下午
 */
@Controller
class TablesController {

    @GetMapping(value = ["/basic_table"])
    fun  basic_Table()="table/basic_table";

    /**
     * 产生数据供页面动态数据使用，写入请求域
     */
    @GetMapping(value = ["/dynamic_table"])
    fun dynamic_table(model:Model):String{
        var users = ArrayList<User>()
        users.add(User("古尔丹","guerdan"));
        users.add(User("伊利丹","yilidan"));
        users.add(User("马丁弗洛","Martix"));
        model.addAttribute("users",users);
        return "table/dynamic_table";
    }

    @GetMapping(value = ["/editable_table"])
    fun editable_table()="table/editable_table";

    @GetMapping(value = ["/pricing_table"])
    fun pricing_table()="table/pricing_table";

    @GetMapping(value = ["/responsive_table"])
    fun responsive_table()="table/responsive_table";
}